initial commit

This commit is contained in:
m.zare
2026-04-10 18:25:21 +03:30
commit 77ca6c34a3
263 changed files with 34470 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
package hashids
import (
"fmt"
"os"
"testing"
"github.com/stretchr/testify/require"
)
func TestDecodeCode(t *testing.T) {
//code := "p5qggj"
//code := "37rx8m"
//code := "37r9dn"
code := "pz9vew"
err := os.Setenv("HASH_SALT", "qtyq68eqeqwy")
res, err := DecodeCode(code)
require.NoError(t, err)
fmt.Println(res)
}
func TestGenerateCode(t *testing.T) {
var productHub, dasht int64 = 1, 2
err := os.Setenv("HASH_SALT", "qtyq68eqeqwy")
require.NoError(t, err)
phub := GenerateCode(productHub)
fmt.Println(phub)
dashtID := GenerateCode(dasht)
fmt.Println(dashtID)
}