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

1.8 KiB

module sha1

Contents

Constants

const size = 20

The size of a SHA-1 checksum in bytes.

[Return to contents]

const block_size = 64

The blocksize of SHA-1 in bytes.

[Return to contents]

hexhash

fn hexhash(s string) string

hexhash returns a hexadecimal SHA1 hash sum string of s.

[Return to contents]

new

fn new() &Digest

new returns a new Digest (implementing hash.Hash) computing the SHA1 checksum.

[Return to contents]

sum

fn sum(data []u8) []u8

sum returns the SHA-1 checksum of the bytes passed in 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 a copy of the generated sum of the 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