Files
herolib/aiprompts/v_core/crypto/sha512.md
2025-09-02 07:28:13 +02:00

3.9 KiB

module sha512

Contents

Constants

const size = 64

size is the size, in bytes, of a SHA-512 checksum.

[Return to contents]

const size224 = 28

size224 is the size, in bytes, of a SHA-512/224 checksum.

[Return to contents]

const size256 = 32

size256 is the size, in bytes, of a SHA-512/256 checksum.

[Return to contents]

const size384 = 48

size384 is the size, in bytes, of a SHA-384 checksum.

[Return to contents]

const block_size = 128

block_size is the block size, in bytes, of the SHA-512/224, SHA-512/256, SHA-384 and SHA-512 hash functions.

[Return to contents]

hexhash

fn hexhash(s string) string

hexhash returns a hexadecimal SHA512 hash sum string of s.

[Return to contents]

hexhash_384

fn hexhash_384(s string) string

hexhash_384 returns a hexadecimal SHA384 hash sum string of s.

[Return to contents]

hexhash_512_224

fn hexhash_512_224(s string) string

hexhash_512_224 returns a hexadecimal SHA512/224 hash sum string of s.

[Return to contents]

hexhash_512_256

fn hexhash_512_256(s string) string

hexhash_512_256 returns a hexadecimal 512/256 hash sum string of s.

[Return to contents]

new

fn new() &Digest

new returns a new Digest (implementing hash.Hash) computing the SHA-512 checksum.

[Return to contents]

new384

fn new384() &Digest

new384 returns a new Digest (implementing hash.Hash) computing the SHA-384 checksum.

[Return to contents]

new512_224

fn new512_224() &Digest

new512_224 returns a new Digest (implementing hash.Hash) computing the SHA-512/224 checksum.

[Return to contents]

new512_256

fn new512_256() &Digest

new512_256 returns a new Digest (implementing hash.Hash) computing the SHA-512/256 checksum.

[Return to contents]

sum384

fn sum384(data []u8) []u8

sum384 returns the SHA384 checksum of the data.

[Return to contents]

sum512

fn sum512(data []u8) []u8

sum512 returns the SHA512 checksum of the data.

[Return to contents]

sum512_224

fn sum512_224(data []u8) []u8

sum512_224 returns the Sum512/224 checksum of the data.

[Return to contents]

sum512_256

fn sum512_256(data []u8) []u8

sum512_256 returns the Sum512/256 checksum of the data.

[Return to contents]

Digest

free

fn (mut d Digest) free()

free the resources taken by the Digest d

[Return to contents]

reset

fn (mut d Digest) reset()

reset the state of the Digest d

[Return to contents]

write

fn (mut d Digest) write(p_ []u8) !int

write writes the contents of p_ to the internal hash representation.

[Return to contents]

sum

fn (d &Digest) sum(b_in []u8) []u8

sum returns the SHA512 or SHA384 checksum of digest with the data bytes in b_in

[Return to contents]

size

fn (d &Digest) size() int

size returns the size of the checksum in bytes.

[Return to contents]

block_size

fn (d &Digest) block_size() int

block_size returns the block size of the checksum in bytes.

[Return to contents]

Powered by vdoc. Generated on: 2 Sep 2025 07:18:17