keefertaylor / base58swift Goto Github PK
View Code? Open in Web Editor NEWA pure swift implementation of base58 string encoding and decoding
License: MIT License
A pure swift implementation of base58 string encoding and decoding
License: MIT License
The decoding of string 11111111111111111111111111111111
to bytes wasn't correct
Expected result: [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
Reality: [49,49,...]
Attempted to use example code from README
let bytes: [UInt8] = [255, 254, 253, 252]
let encodedString = Base58.encode(bytes)
let decodedBytes = Base58.decode(encodedString)!
print(encodedString) // 7YXVWT
print(decodedBytes) // [255, 254, 253, 252]
Fails to compile with noted error
Example:
let bytes: [UInt8] = [0, 128, 128, 128]
let encodedString = Base58.base58CheckEncode(bytes)
let decodedBytes = Base58.base58CheckDecode(encodedString)! // <- fails here
What is the issue:
When I go ahead and encode a value to Base58, everything works as intended (e.g., correct hash). However, when decoding, I receive the incorrect value. Here is the example:
let test = Base58.base58Encode([UInt8]([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9])) // "1Bhh3pU9gLXZhoVxkr5wyg9sX6"
let test2 = Base58.base58Decode(test) // [49, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
Expected: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
Received: [49, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
Xcode 11 takes Swift packages to the level where they are finally fully useable. I think it would be cool to add the support for it.
Trying to install TezosKit via carthage.
*** Building scheme "Base58Swift_macOS" in Base58Swift.xcodeproj
Build Failed
Task failed with exit code 65:
/usr/bin/xcrun xcodebuild -project /Users/jojo/Documents/CodeProjects/MyProj1/Carthage/Checkouts/Base58Swift/Base58Swift.xcodeproj -scheme Base58Swift_macOS -configuration Release -derivedDataPath /Users/jojo/Library/Caches/org.carthage.CarthageKit/DerivedData/12.3_12C33/Base58Swift/2.1.14 ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath /var/folders/76/q9_yh34j5wd23ksxl7b70ssm0000gn/T/Base58Swift SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO
...
...
/Users/jojo/Library/Caches/org.carthage.CarthageKit/DerivedData/12.3_12C33/Base58Swift/2.1.14/Build/Intermediates.noindex/ArchiveIntermediates/Base58Swift_macOS/IntermediateBuildFilesPath/Base58Swift.build/Release/Base58Swift_macOS.build/Script-836D7AF445A97E1216598BA1.sh: line 2: swiftlint: command not found
This "swiftlint" seems to be some 3rd party tool? But none of the documentation for Base58Swift says I need to install it and it is not a dependency list anywhere
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.