greenServeFEgreenServeFE

Documentation home / Native Module API

Native Module API

Non-cryptographic Hash Functions

FNV-1a and DJB2 hashes with a hash-comparison helper.

Purpose

FNV-1a and DJB2 hashes with a hash-comparison helper.

Exports registered by the module initializer

ExportRole
fnv1afnv1a helper
djb2djb2 helper
same_hashsame hash helper

Usage

import gs_hash;
print(gs_hash.fnv1a("greenServeFE"));
print(gs_hash.djb2("greenServeFE"));
print(gs_hash.same_hash("greenServeFE", "greenServeFE"));
These are not cryptographic hashes. Do not use for password storage, authentication, signatures or security checks.

Related: Module catalog · Native ABI · Language guide.