mirror of
https://github.com/moonD4rk/HackBrowserData.git
synced 2026-05-19 18:58:03 +02:00
feat: add local storage for firefox
This commit is contained in:
@@ -23,6 +23,14 @@ func IntToBool[T constraints.Signed](a T) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func Reverse[T any](s []T) []T {
|
||||
var h = make([]T, len(s))
|
||||
for i := 0; i < len(s); i++ {
|
||||
h[i] = s[len(s)-i-1]
|
||||
}
|
||||
return h
|
||||
}
|
||||
|
||||
func TimeStamp(stamp int64) time.Time {
|
||||
s := time.Unix(stamp, 0)
|
||||
if s.Local().Year() > 9999 {
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package typeutil
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
var (
|
||||
reverseTestCases = [][]any{
|
||||
[]any{1, 2, 3, 4, 5},
|
||||
[]any{"1", "2", "3", "4", "5"},
|
||||
[]any{"1", 2, "3", "4", 5},
|
||||
}
|
||||
)
|
||||
|
||||
func TestReverse(t *testing.T) {
|
||||
for _, ts := range reverseTestCases {
|
||||
h := Reverse(ts)
|
||||
for i := 0; i < len(ts); i++ {
|
||||
if h[len(h)-i-1] != ts[i] {
|
||||
t.Errorf("reverse failed %v != %v", h, ts)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user