8. CHAPTER
NINETY
RINGMURMURHASH FUNCTIONS REFERENCE
ā MurmurHash is a non-cryptographic hash function suitable for general hash-based lookup. It was created by
Austin Appleby in 2008 and is currently hosted on Github along with its test suite named āSMHasherā. It also
exists in a number of variants,[5] all of which have been released into the public domain. The name comes from
two basic operations, multiply (MU) and rotate (R), used in its inner loop. ā
Murmurhash extension is an extension written to implement a full implementation for the MurmurHash library.
Developer: Hassan Ahmed
90.1 MurmurHash1 functions
uint32_t murmurhash1(string key, int seed, [bool return_type]);
uint32_t murmurhash1_aligned(string key, int seed, [bool return_type]);
90.2 MurmurHash2 functions
uint32_t murmurhash2(string key, int seed, [bool return_type]);
uint32_t murmurhash2a(string key, int seed, [bool return_type]);
uint64_t murmurhash64a(string key, int seed, [bool return_type]);
uint64_t murmurhash64b(string key, int seed, [bool return_type]);
uint32_t murmurhash_neutral2(string key, int seed, [bool return_type]);
uint32_t murmurhash_aligned2(string key, int seed, [bool return_type]);
90.3 MurmurHash3 functions
uint32_t murmurhash3_x86_32(string key, int seed, [bool return_type]);
list murmurhash3_x86_128(string key, int seed, [bool return_type]);
list murmurhash3_x64_128(string key, int seed, [bool return_type]);
The third optional parameter is to set the type of the returned value, this parameter accepts a bool value [ true, false ],
true will return a Hex value, while false will return a integer value.
1215
9. Ring Documentation, Release 1.10
90.4 Example
load "murmurhashlib.ring"
key = "Ring Language"
see murmurhash3_x86_32(key, 0, 0) + nl // Output: 1894444853
see murmurhash3_x86_32(key, 0, 1) + nl // Output: 70eaef35
90.4. Example 1216
10. CHAPTER
NINETYONE
FOXRING FUNCTIONS REFERENCE
As a FoxPro developer, I started writing a class with some of the functions I used in FoxPro.
The goal is to create as many functions as possible with the behavior similar to FoxPro functions.
Developer: Jose Rosado
91.1 FoxRing functions
Function Name Description
frAbs() Returns the absolute value of the speciļ¬ed numeric expression.
frAddBs() Adds a backslash (if needed) to a path expression.
frALines() Creates an Array with the content of the speciļ¬ed string.
frAllTrim() Removes all leading and trailing spaces of the speciļ¬ed string.
frAsc() Returns the ANSI value for the leftmost character in a character expression.
frAt() Searches a character expression for the occurrence
of another character expression.
frAtC() Searches a character expression for the ocurrence of another character expression without
regard for the case of these two expressions.
frBetween() Determines whether the value of an expression is inclusively between the values of two
expressions of the same type.
frChr() Returns the character associated with the speciļ¬ed numeric ANSI code.
frEmpty() Determines whether an expression evaluates to empty.
frFile() Checks if a ļ¬le exists on disk.
frFileToStr() Returns the contents of a ļ¬le as a character string.
frForceExt() Returns a string with the old ļ¬le name extension replaced by a new extension.
frForcePath() Returns a ļ¬le name with a new path name substituted for the old one.
frIif() Returns one of two values depending on the value of a logical expression.
frInList() Determines whether an expression matches another expression in a list.
frInt() Evaluates a numeric expression and returns the integer portion of the expression.
frJustDrive() Returns the drive letter from a complete path.
frJustExt() Returns the characters of a ļ¬le extension from a complete path.
frJustFName() Returns the ļ¬le name portion of a complete path and ļ¬le name.
frJustPath() Returns the path portion of a complete path and ļ¬le name.
frJustStem() Returns the stem name (the ļ¬le name before the extension)
from a complete path and ļ¬le name.
frLen() Determines the number of characters in a character expression,
indicating the length of the expression.
Continued on next page
1217