From 95cc61fd4d590822c10aefe1def487287c95cb85 Mon Sep 17 00:00:00 2001 From: Ze'ev Schurmann Date: Sun, 7 Jun 2026 01:03:57 +0200 Subject: [PATCH] v1.1 - Fixed bug where strings were being hashed with a newline at the end. Pyhon doesn't do this so Bash script was updated to act the same as Python. --- README.md | 2 +- zotp.inc.sh | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 727894f..4b81372 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # zOTP Bash - Generates/Tests One Time Pins in Bash Scripts -- Current Version : 1.0 +- Current Version : 1.1 - Author : Ze'ev Schurmann - Git Repo : https://git.3volve.net.za/thisiszeev/zotp-bash - Reddit : u/thisiszeev diff --git a/zotp.inc.sh b/zotp.inc.sh index 8fbe9c0..5e32f8b 100644 --- a/zotp.inc.sh +++ b/zotp.inc.sh @@ -1,7 +1,7 @@ #!/bin/bash ## zOTP Bash - Generates/Tests One Time Pins in Bash Scripts -## Version : 1.0 +## Version : 1.1 ## Author : Ze'ev Schurmann ## Git Repo : https://git.3volve.net.za/thisiszeev/zotp-bash ## Reddit : u/thisiszeev @@ -133,13 +133,13 @@ function genHash { fi if [[ -z "${precmd}" ]] && [[ -z "${postcmd}" ]]; then - echo -e "${1}" | ${hashcmd} + echo -en "${1}" | ${hashcmd} elif [[ -z "${precmd}" ]] && [[ -n "${postcmd}" ]]; then - echo -e "${1}" | ${hashcmd} | ${postcmd} + echo -en "${1}" | ${hashcmd} | ${postcmd} elif [[ -n "${precmd}" ]] && [[ -z "${postcmd}" ]]; then - echo -e "${1}" | ${precmd} | ${hashcmd} + echo -en "${1}" | ${precmd} | ${hashcmd} elif [[ -n "${precmd}" ]] && [[ -n "${postcmd}" ]]; then - echo -e "${1}" | ${precmd} | ${hashcmd} | ${postcmd} + echo -en "${1}" | ${precmd} | ${hashcmd} | ${postcmd} fi return 0