common

package
v0.0.0-...-b2a8830 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2016 License: BSD-2-Clause Imports: 0 Imported by: 0

Documentation

Overview

Package common contains routines used by multiple password hashing algorithms.

Generally, you will never import this package directly. Many of the *_crypt packages will import this package if they require it.

Index

Constants

View Source
const Hash64Chars = "./0123456789" +
	"ABCDEFGHIJKLMNOPQRSTUVWXYZ" +
	"abcdefghijklmnopqrstuvwxyz"

Hash64Chars is the character set used by the Hash64 encoding algorithm.

Variables

This section is empty.

Functions

func Hash64

func Hash64(src []byte) (hash []byte)

Hash64 is a variant of Base64 encoding. It is commonly used with password hashing algorithms to encode the result of their checksum output.

The algorithm operates on up to 3 bytes at a time, encoding the following 6-bit sequences into up to 4 hash64 ASCII bytes.

  1. Bottom 6 bits of the first byte
  2. Top 2 bits of the first byte, and bottom 4 bits of the second byte.
  3. Top 4 bits of the second byte, and bottom 2 bits of the third byte.
  4. Top 6 bits of the third byte.

This encoding method does not emit padding bytes as Base64 does.

Types

This section is empty.

Jump to

Keyboard shortcuts

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