Index

Package: Hashed_Strings

Description

package Hashed_Strings is

Types

Hashed_String

type Hashed_String is private;
A Hashed_String is built from a fixed string using a case-sensitive hash function so that it can quickly be compared to other hashed strings. Note that the comparison isn't 100% accurate because hash collisions for differing strings are possible. Use a Hashed_String if you have a constant, case-sensitive string that needs to be compared with other constant strings frequently.

Subprograms & Entries

=

function "="
( l, r: Hashed_String ) return Boolean;
Returns True if the Hashed_Strings match based on hash comparison. This isn't 100% accurate. See the comments for the Hashed_String type.

<

function "<"
( l, r: Hashed_String ) return Boolean;
Like the '=' operator, this function is based on hash comparison.

&

function "&"
( l: Hashed_String;
r: String ) return String;
Returns a string from the concatenation of a Hashed_String with a fixed string.

&

function "&"
( l: String;
r: Hashed_String ) return String;
Returns a string from the concatenation of a fixed string with a Hashed_String.

&

function "&"
( l, r: Hashed_String ) return String;
Returns a string from the concatenation of two Hashed_Strings.

Equivalent

function Equivalent
( l, r: Hashed_String ) return Boolean;
Returns True if the Hashed_Strings match exactly. This is slower than the '=' operator because the string contents will be compared if the hash values match.

To_Hashed_String

function To_Hashed_String
( str: String ) return Hashed_String;
Makes a Hashed_String from a fixed string.

To_String

function To_String
( hs: Hashed_String ) return String;
Returns the Hashed_String's internal string.