在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):cakenggt/Library-Of-Pybel开源软件地址(OpenSource Url):https://github.com/cakenggt/Library-Of-Pybel开源编程语言(OpenSource Language):Python 100.0%开源软件介绍(OpenSource Introduction):Library Of PybelAboutThis is an open source python implementation of the Library of Babel. FunctionalityJavascript ImplementationThe Javascript implementation of the Library of Babel can be found here. The text and addresses generated will not be the same between the Python implementation and this one. The source code for this JS implementation is hosted in the gh-pages branch. There is a search box and an address selector. Python ImplementationNote: all numbers are started at 0, not 1. To find the first page of a book, look for page 0 Address format: Examples:
Run the file from the command line with an action argument. The following arguments are supported:
ExplanationWhat was needed for this project was a way to generate seemingly random pages in a near-infinite address space which could also be searched for specific strings. I realized not early on that what I needed was not a reversible RNG, but in fact an encoding scheme to cleverly encode the page's text in the address of the book. Paired with a seeded RNG for shorter pages, I could reliably generate random pages, but also encode specific text into the page to be generated. To understand the encoding, you must think of the hex address of the book as a base-36 number and the text of the book as a base-29 number (26 letters plus space, comma, and period). The wall, shelf, volume, and page can be thought of as a base-10 number independent of the hex address. This base-10 number will be referred to as the location. Specifically, when text is searched for, that text is padded with a random amount of characters on it's front and back side, or in the case of the The page text is then converted from a string to a number. The location number is multiplied by a very large number and is then added to the page text number. Then the new page text number is converted into base-36, and that is the address. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论