Skip to content
FutureBlitz

    Install

    Import std.crypto.hashes

    Sha1

    std.crypto.hashes

    class

    Public Class Sha1 Implements Hasher

    SHA-1's 20 bytes, only for checksums and the formats that ask for it, like Git's.

    Examples

    Expect(Hex.Encode(Sha1.Hash("abc")) == "a9993e364706816aba3e25717850c26c9cd0d89d")

    std/crypto/hashes.fb, line 97

    • Public New() constructor #

      A new Sha1, of nothing.

    • Public Static Method Hash(data: UInt8[]): UInt8[] static method #

      The SHA-1 of data.

    • Public Static Method Hash(text: String): UInt8[] static method #

      The SHA-1 of text's UTF-8 bytes.

    • Public Method Add(data: UInt8[]) method #

      Adds data to what it hashes.

    • Public Method Add(text: String) method #

      Adds text's UTF-8 bytes to what it hashes.

    • Public Method Finish(): UInt8[] method #

      The 20-byte SHA-1 of what was added, after which it starts again, empty.

    Report an issue with this page or with FutureBlitz on GitHub.