Skip to content
FutureBlitz

    Install

    Import std.crypto.hashes

    Sha256

    std.crypto.hashes

    class

    Public Class Sha256 Implements Hasher

    SHA-256's 32 bytes.

    Examples

    Expect(Hex.Encode(Sha256.Hash("abc")) ==
           "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad")
    Local hasher = Sha256()
    hasher.Add("ab")
    hasher.Add("c".Bytes)
    Expect(hasher.Finish() == Sha256.Hash("abc"))

    std/crypto/hashes.fb, line 141

    • Public New() constructor #

      A new Sha256, of nothing.

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

      The SHA-256 of data.

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

      The SHA-256 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 32-byte SHA-256 of what was added, after which it starts again, empty.

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