util.hashes API

Provides utility functions for hashing strings according to several popular algorithms.

The algorithms currently supported are:

  • MD5
  • SHA1
  • SHA256

Usage

   local hashes = require "util.hashes";

Reference

hashes.md5(string, hex)

hashes.sha1(string, hex)

hashes.sha256(string, hex)

All of the above functions return a hash string according to the chosen algorithm. By default the raw binary form is returned, most often you will want to pass true as the second parameter to get a nice hex-encoded string.

 
doc/developers/util/hashes.txt · Last modified: 2009/12/20 17:43 (external edit)