crc32

    MoonBit crc32: provide simple crc32 hash algorithm.

    crc32
    hash
    algorithm
    moonbit
    Download zip
    Author
    Version
    0.8.16
    License
    Apache-2.0
    Last updated
    7 months ago
    Downloads
    5K

    #gmlewis/crc32

    check

    This is a simple crc32 hash algorithm based on the Go Rosetta Stone implementation found here: https://rosettacode.org/wiki/CRC-32 which has the copyright notice:

    Content is available under GNU Free Document License 1.3 unless otherwise noted.

    #Status

    The code has been updated to support compiler:

    $ moon version --all moon 0.1.20260119 (be99339 2026-01-19) ~/.moon/bin/moon moonc v0.7.2+938b1f804 (2026-01-20) ~/.moon/bin/moonc moonrun 0.1.20260119 (be99339 2026-01-19) ~/.moon/bin/moonrun moon-pilot 0.0.1-df92511 (2026-01-20) ~/.moon/bin/moon-pilot

    HashFunc

    pub(open) trait HashFunc {
    name(Self) -> String
    write(Self, Byte) -> Unit
    check_sum(Self) -> String
    }

    HashFunc represents a hash algorithm like @crc32, @md5, or @sha256.

    Digest

    pub(all) struct Digest {
    crc : UInt
    name : String
    }

    @crc32.Digest implements the 32-bit cyclic redundancy check, or CRC-32, checksum. See https://en.wikipedia.org/wiki/Cyclic_redundancy_check for information. This package is based on the Go Rosetta Stone implementation found here: https://rosettacode.org/wiki/CRC-32
    impl HashFunc for Digest

    Digest::digest

    fn Digest::digest(self : Digest) -> UInt

    digest returns the final crc32 as a UInt.

    Digest::new

    fn Digest::new() -> Digest

    Digest::new returns a new, reset Digest, ready to sum.

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io