From 754703844ba5ed118fe0d1858e61d1a203615454 Mon Sep 17 00:00:00 2001 From: Arjun Satarkar Date: Thu, 16 Feb 2023 17:50:43 +0000 Subject: Make readme Asciidoc --- README.adoc | 23 +++++++++++++++++++++++ README.md | 23 ----------------------- 2 files changed, 23 insertions(+), 23 deletions(-) create mode 100644 README.adoc delete mode 100644 README.md diff --git a/README.adoc b/README.adoc new file mode 100644 index 0000000..c3dc35d --- /dev/null +++ b/README.adoc @@ -0,0 +1,23 @@ += 8hash + +A consistent "magic 8-ball" that chooses the result based on a hash of the input string, so that it always returns the same result when given the same input (or fails to return a concrete answer). + +Since the standard non-committal answers in a magic 8-ball indicate that you should try again later, we first randomly decide if we should use a non-committal answer or not, and only if not, use the hash of the input to pick an unchanging committal answer. + +We use the "djb2" hash function because of its simplicity. + +== Rationale + +It is somewhat strange that magic 8-balls, both physical and digital, can return opposite responses to the same question. At least in the digital case, we can mitigate this. + +Of course, if you get an answer not to your liking, you can reword your query to try for a new one. + +== Usage and info + +Run `./eight_hash.py` for interactive use, or `import eight_hash` to use as a library. We have to spell out eight because identifiers can't start with a number :(. + +== Copying + +The author of this software is Arjun Satarkar. + +This software can be used under the CC0 1.0 Universal. See the COPYING.txt file for the full text. diff --git a/README.md b/README.md deleted file mode 100644 index 369e7d6..0000000 --- a/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# 8hash - -A consistent "magic 8-ball" that chooses the result based on a hash of the input string, so that it always returns the same result when given the same input (or fails to return a concrete answer). - -Since the standard non-committal answers in a magic 8-ball indicate that you should try again later, we first randomly decide if we should use a non-committal answer or not, and only if not, use the hash of the input to pick an unchanging committal answer. - -We use the "djb2" hash function because of its simplicity. - -## Rationale - -It is somewhat strange that magic 8-balls, both physical and digital, can return opposite responses to the same question. At least in the digital case, we can mitigate this. - -Of course, if you get an answer not to your liking, you can reword your query to try for a new one. - -## Usage and info - -Run `./eight_hash.py` for interactive use, or `import eight_hash` to use as a library. We have to spell out eight because identifiers can't start with a number :(. - -## Copying - -The author of this software is Arjun Satarkar. - -This software can be used under the CC0 1.0 Universal. See the COPYING.txt file for the full text. -- cgit v1.2.3-57-g22cb