Skip to content

The crypto bcrypt library

github-actions[bot] edited this page Jul 14, 2026 · 4 revisions

Overview

The bcrypt library implements Provos and Mazières's bcrypt adaptive hashing algorithm. See (http://www.usenix.org/event/usenix99/provos/provos.pdf.)

Modules

("golang.org/x/crypto/bcrypt")

Constants

DEFAULT_COST

The default cost used by the hashing function.

Functions

compare(hashedPassword string, plaintext string) -> bool

Compares a bcrypt hashed password with its possible plaintext equivalent. on success, or an error on failure.

hash(s string) -> string / error

Returns the bcrypt hash of the password using the default cost defined in this package.

hash does not accept passwords longer than 72 characters, which is the longest password bcrypt will operate on.

hash(s string, cost int) -> string / error

Returns the bcrypt hash of the password at the given cost. If the cost given is less than 4, the cost will be set to DEFAULT_COST,

Notes

This page is automatically generated from the Pipefish standard library. Any edits made directly to this wiki page will be overwritten the next time the documentation is regenerated.

🧿 Pipefish

Clone this wiki locally