🐛 Fix: password runecount calc error

This commit is contained in:
Cell
2024-07-22 15:40:29 +08:00
parent 03e9b119cc
commit affaea7ecb
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -164,7 +164,7 @@
{{- /* Content */ -}}
{{- $content := dict "Content" .Content "Ruby" $params.ruby "Fraction" $params.fraction "Fontawesome" $params.fontawesome | partial "function/content.html" | safeHTML -}}
{{- if $params.password -}}
{{- $saltLen := strings.RuneCount (trim $params.password "") -}}
{{- $saltLen := strings.RuneCount (trim $params.password " ") -}}
{{- $saltLen = cond (eq (mod $saltLen 2) 0) (add $saltLen 1) $saltLen -}}
{{- $base64EncodeContent := $content | base64Encode -}}
{{- $content = printf "%v%v%v"