Skip to content

A Swift implementation of the Fowler–Noll–Vo (FNV) hash function.

License

Notifications You must be signed in to change notification settings

mauriciosantos/FNVHash-Swift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

A Swift implementation of the Fowler–Noll–Vo (FNV) hash function

This code provides implementations of the FNV-1 and FNV-1a hash functions in pure Swift. Computes 64-bit hashes on 64-bit devices and 32-bit hashes on 32-bit devices.

Usage

// Strings

let fnv1Hash = fnv1("test")
let fnv1aHash = fnv1a("test")

// Integers, Floats, Doubles

let fnv1Hash = fnv1(5)
let fnv1aHash = fnv1a(5.5)

// Raw bytes

let bytes: [UInt8] = [10, 20, 30]

let fnv1Hash = fnv1(bytes)
let fnv1aHash = fnv1a(bytes)

Additional information

Fowler–Noll–Vo hash function

Contact

Mauricio Santos, [email protected]

About

A Swift implementation of the Fowler–Noll–Vo (FNV) hash function.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages