API reference Dodo 0.1.4

std/hash

Public declarations, types, methods, and source contracts for std/hash.

On this page

Library guide · API index and notation

This page is generated from the bundled library in this checkout. Signatures and adjacent source comments are reproduced below; the linked guide explains usage, storage, failures, and platform support.

import "std/hash"

Names used in signatures

Unqualified names denote this package’s types (including other source files in the same package), language built-ins, or generic parameters such as T. Qualified names use the import aliases below. These aliases belong to the library source; import a dependency yourself to use its alias in your program.

Alias Package Source file
bytes core/bytes hash.dodo
mem core/mem hash.dodo
text std/text hash.dodo

KeyError

Enum · Source

Entropy acquisition belongs to the caller’s source. No global or fallback key.

pub enum KeyError {
    Unavailable
}

Key128

Struct · Source

pub struct Key128 {
    // Private implementation fields omitted.
}

Key128.new

Function · Source

pub fn new(k0: u64, k1: u64) -> Key128

Key128.word0

Function · Source

pub fn word0(&self) -> u64

Key128.word1

Function · Source

pub fn word1(&self) -> u64

Key128.hasher

Function · Source

pub fn hasher(&self) -> SipHash24

Key128.u64_policy

Function · Source

pub fn u64_policy(&self) -> SipU64

Key128.i32_policy

Function · Source

pub fn i32_policy(&self) -> SipI32

obtain_key

Function · Source

Static capability S.next_key(&mut self)->Key128!KeyError. The source is responsible for key quality. Errors propagate unchanged, without retry or substituting a predictable key. Successful calls consume one source request.

pub fn obtain_key<S>(source: &mut S) -> Key128!KeyError

Fnv1a64

Struct · Source

pub struct Fnv1a64 {
    // Private implementation fields omitted.
}

Fnv1a64.new

Function · Source

pub fn new() -> Fnv1a64

Fnv1a64.seeded

Function · Source

The seed replaces the offset basis; it is not an entropy/security key.

pub fn seeded(seed: u64) -> Fnv1a64

Fnv1a64.update

Function · Source

pub fn update(&mut self, data: &[u8])

Fnv1a64.finish

Function · Source

pub fn finish(&self) -> u64

Fnv1a64.reset

Function · Source

pub fn reset(&mut self)

SipHash24

Struct · Source

Bernstein/Aumasson SipHash-2-4: 128-bit explicit key, 64-bit output. Key words represent bytes 0..7 and 8..15 in little-endian order.

pub struct SipHash24 {
    // Private implementation fields omitted.
}

SipHash24.new

Function · Source

pub fn new(k0: u64, k1: u64) -> SipHash24

SipHash24.update

Function · Source

pub fn update(&mut self, data: &[u8])

SipHash24.finish

Function · Source

Snapshot finalization: repeatable and does not consume/reset the stream.

pub fn finish(&self) -> u64

SipHash24.reset

Function · Source

pub fn reset(&mut self)

fnv1a64

Function · Source

pub fn fnv1a64(data: &[u8]) -> u64

siphash24

Function · Source

pub fn siphash24(data: &[u8], k0: u64, k1: u64) -> u64

write_u64

Function · Source

Monomorphized contract: H.update(&mut self, &[u8]); H.finish(&self)->u64. Prefix variable-size fields with lengths to distinguish composite encodings.

pub fn write_u64<H>(state: &mut H, value: u64)

write_i32

Function · Source

pub fn write_i32<H>(state: &mut H, value: i32)

write_bytes

Function · Source

pub fn write_bytes<H>(state: &mut H, data: &[u8])

U64

Struct · Source

pub struct U64 {

}

U64.hash

Function · Source

pub fn hash(&self, key: &u64) -> u64

U64.equal

Function · Source

pub fn equal(&self, a: &u64, b: &u64) -> bool

I32

Struct · Source

pub struct I32 {

}

I32.hash

Function · Source

pub fn hash(&self, key: &i32) -> u64

I32.equal

Function · Source

pub fn equal(&self, a: &i32, b: &i32) -> bool

SipU64

Struct · Source

pub struct SipU64 {
    // Private implementation fields omitted.
}

SipU64.new

Function · Source

pub fn new(k0: u64, k1: u64) -> SipU64

SipU64.hash

Function · Source

pub fn hash(&self, key: &u64) -> u64

SipU64.equal

Function · Source

pub fn equal(&self, a: &u64, b: &u64) -> bool

SipI32

Struct · Source

pub struct SipI32 {
    // Private implementation fields omitted.
}

SipI32.new

Function · Source

pub fn new(k0: u64, k1: u64) -> SipI32

SipI32.hash

Function · Source

pub fn hash(&self, key: &i32) -> u64

SipI32.equal

Function · Source

pub fn equal(&self, a: &i32, b: &i32) -> bool

Str

Struct · Source

Text keys compare/hash UTF-8 contents, never pointer addresses.

pub struct Str {

}

Str.compare

Function · Source

pub fn compare(&self, a: & &str, b: & &str) -> i32

Str.equal

Function · Source

pub fn equal(&self, a: & &str, b: & &str) -> bool

Str.hash

Function · Source

pub fn hash(&self, key: & &str) -> u64

Text

Struct · Source

pub struct Text {

}

Text.compare

Function · Source

pub fn compare(&self, a: &text.Text, b: &text.Text) -> i32

Text.equal

Function · Source

pub fn equal(&self, a: &text.Text, b: &text.Text) -> bool

Text.hash

Function · Source

pub fn hash(&self, key: &text.Text) -> u64

SipStr

Struct · Source

pub struct SipStr {
    // Private implementation fields omitted.
}

SipStr.new

Function · Source

pub fn new(k0: u64, k1: u64) -> SipStr

SipStr.equal

Function · Source

pub fn equal(&self, a: & &str, b: & &str) -> bool

SipStr.hash

Function · Source

pub fn hash(&self, key: & &str) -> u64

Type to search all documentation.

Keyboard shortcuts

Search documentation
Ctrl K or /
Move through results
↑ ↓
Open selected result
Enter
Close a dialog
Esc
Show these shortcuts
?