From 41d0dde4c01ef17c775cf793305b8660eea11c80 Mon Sep 17 00:00:00 2001 From: Abhimanyu Sharma Date: Sun, 26 May 2024 18:52:01 +0530 Subject: [PATCH] Fix: bcrypt ignoring rounds-parameter --- processors/crypto.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/processors/crypto.go b/processors/crypto.go index bb418b2..d9aa8a4 100644 --- a/processors/crypto.go +++ b/processors/crypto.go @@ -234,17 +234,17 @@ func (p Bcrypt) Alias() []string { } func (p Bcrypt) Transform(data []byte, f ...Flag) (string, error) { - var rounds int + var rounds uint for _, flag := range f { if flag.Short == "r" { - r, ok := flag.Value.(int) + r, ok := flag.Value.(uint) if ok { rounds = r } } } - bytes, err := bcrypt.GenerateFromPassword(data, rounds) + bytes, err := bcrypt.GenerateFromPassword(data, int(rounds)) return string(bytes), err }