module
Version:
v0.2.0
Opens a new window with list of versions in this module.
Published: Sep 25, 2020
License: Apache-2.0
Opens a new window with license information.
README
¶
Intro
Fast generate short url and redirection.
Key Features
-
Using xorshift fast generate pseudorandom number. Benchmark output:
goos: windows
goarch: amd64
pkg: github.com/drrrMikado/shorten/fastrand
BenchmarkCryptorandStr-12 500660 2260 ns/op 456 B/op 33 allocs/op
BenchmarkMathrandStr-12 20852 57259 ns/op 8 B/op 1 allocs/op
BenchmarkFastrandStr-12 6433384 197 ns/op 8 B/op 1 allocs/op
PASS
ok github.com/drrrMikado/shorten/fastrand 4.538s
-
Using bloom filter fast determine whether the generated string already exists
-
Bloom filter hash function use MurmurHash3 of MurmurHash
TODO
- Redis storage
- inner HTML template
- Generating strings multiple times for a link should be the same as before
- Visit count (long term)
Directories
¶
|
|
internal
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Click to show internal directories.
Click to hide internal directories.