djb2

package
v2.20.0 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2024 License: MIT Imports: 1 Imported by: 0

README

API

生成 djb2 Hash(uint64)

func Sum(s string) uint64

生成 djb2 Hash(字符串)

func Make(s string) string

校验 djb2 Hash

func Check(s string, hash string) bool

示例

package main

import (
	"fmt"

	"github.com/o8x/jk/djb2"
)

func main() {
	sum := djb2.Make("hello world")
	
	fmt.Println("sum", sum)
	fmt.Println("check sum", djb2.Check("hello world", sum))
}

运行它

> go run .
sum 13876786532495509697
check sum true

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check

func Check(s string, hash string) bool

func Make

func Make(s string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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