-
Notifications
You must be signed in to change notification settings - Fork 0
Cloud Encoder
Ankit_Anmol edited this page Jan 19, 2022
·
12 revisions
Note: If you are using this feature to encode/decode clouddata from scratch, you need to use this encoder only (Scratch side): Scratch encoder/decoder
from ScraGet import ScraGet
data = ["hello!", 23] #you can put anything to encode in this list.
encoder = ScraGet.encoder()
x = encoder.encode(data) #Data only should be in list format
print(f"encoded: {x}")
The data should only be a list. It can be a single item list too! Items in list can be int, str and float!
from ScraGet import ScraGet
encoder = ScraGet.encoder()
x = encoder.encode(["hey! how are you?"]) #encoding the list
print(f"decoded: {encoder.decode(x)}") #decoding and printing
print(encoder.decode("120045003456789000")) #decoding by directly inputting number. Must be str because of limitation of prefix 0 in int...
Note that the value to decode should not be of odd number of digits and should be a whole number in string format.
The output from decoder is a list with all str items regardless of what types you encoded to save cloud space.
Any API you know not covered by this library? Any mistake in this wiki? Create an issue!
Have questions? Ask in the Q/A section!