crypto

package
v0.0.0-...-dd27f12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 29, 2015 License: Zlib Imports: 3 Imported by: 2

Documentation

Overview

Package crypto is for cryptographic or similar kinds of functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fnv

func Fnv(data string) string

Fnv is a non-cryptographic hashing function based on non-cryptographic hash functions created by Glenn Fowler, Landon Curt Noll, and Phong Vo. This wraps the standard library FNV hash function by representing it as a 32 bit integer. Then it takes that number and "hashes" it by adding the rune's unicode value (as a uint 32) and then takes the modulus of 26, letting the number be represented as a letter of the alphabet. This is not a cryptographically secure operation, it is purely to replace numbers with a human-readable string to satisfy the requirement that any vhost with a "/" in it cannot end in a number (to avoid someone obtaining a vhost that is a cidr mask, it can cause issues).

func Hash

func Hash(data string, salt string) string

Hash is a simple wrapper around the MD5 algorithm implementation in the Go standard library. It takes in data and a salt and returns the hashed representation.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL