summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorbt <bt@rctt.net>2026-05-24 18:52:58 +0200
committerbt <bt@rctt.net>2026-05-24 18:52:58 +0200
commit51c603afe0373f45f8d389c99cac9d3aec959b75 (patch)
tree77de75fbfec26c332bcaf79424c66cd0e9615be8 /core
parentcd925e3c7716216902f3a0ef4c333f32e5f1bdb4 (diff)
downloadsolec-51c603afe0373f45f8d389c99cac9d3aec959b75.tar.gz
solec-51c603afe0373f45f8d389c99cac9d3aec959b75.zip
[common] Users and permissions database
Diffstat (limited to 'core')
-rw-r--r--core/internal.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/core/internal.go b/core/internal.go
new file mode 100644
index 0000000..e00c0f2
--- /dev/null
+++ b/core/internal.go
@@ -0,0 +1,24 @@
+package core
+
+import (
+ "encoding/base64"
+
+ "golang.org/x/crypto/bcrypt"
+)
+
+type UserData struct {
+ Name string
+ Pass string
+}
+
+type PermissionData struct {
+ User string
+ Channel string
+ Read bool
+ Write bool
+}
+
+func HashPass(pass string) (string, error) {
+ hash, err := bcrypt.GenerateFromPassword([]byte(pass), 12)
+ return base64.StdEncoding.EncodeToString(hash), err
+}