I am translating some Python code to C++. Parts of the code use base 64 encoding.
The Python code uses RFC 3548 encoding, but the C++ library I am using only has RFC 4648.
I understand that RFC 4648 obsolete RFC 3548, but I could not find out where they differ. I also wrote a program in Python and one in C++ to encode the same plain-text file, and they produce the same output.
So for base 64 encoding, what are the differences between RFC 3548 and 4648?
Executive summary: the text of the standard has changed in minor ways without changing the behavior it describes.
Details:
The IETF page for RFC 4648 contains a link to a diff from RFC 3548 to RFC 4648. Looking over the diff, I see that apparently all of the changes before part 11 (ISO C99 Implementation of Base64) are non-functional grammatical changes.
Part 11 is changed to provide a link to an external implementation rather than providing an implementation inline because “The code could not be included in this RFC for procedural reasons (RFC 3978 section 5.4).” The specific reason is that the C implementation in RFC 3548 included a copyright notice different than the one allowed by RFC 3978.
After that, there are more grammatical changes, some references have been updated, and the copyright, disclaimer, and acknowledgements have been updated.
Related
According to what I read, OpenBSD seems to have its own system on encoding and decoding using Base64. However,I cant find any literature whatsoever that can describe it mathematically. my question is, what is the difference between the usual EncodeBase64 DecodeBase64 with the OpenBSD version? how do we calculate it on math?
I think you're jumping to (unwarranted) conclusions here: the link you provide is a Java implementation of bcrypt and indeed, bcrypt uses a modified base64 definition. See more about the differences on the security stack exchange.
What you should remember is that indeed bcrypt uses a nonstandard base64 dialect (forcing it to provide implementations for base64 within its implementation) but that bcrypt implementations can be supposed to be interoperable as they all need to implement the proprietary encoding scheme.
The link to the Hacker Noon article mentioned on SSE is interesting because it digs deeper into the peculiarities of bcrypt, including its use of a proprietary encoding scheme. Definitely worth a visit.
I am not sure that I answer your full question here but at least the provided pointers should allow you to dig deeper into the subject.
I know there are libraries like bestiejs/punycode.js or NodeJS PunnyCode to convert punycode, but I can't find any library that detect punycode languages(Geek, Chinese, etc).
Is that possible to detect punycode language natively or it has to use different software to detect the languages.
Also, is there any NodeJs library can use for punycode language detection?
The punycode is the ASCII (8 bit) representation of an otherwise 16 bit Unicode based Internationalized Domain Name. The conversion to punycode is termed as a variable length encoding and is a mathematical process, involving additional processings like case-folding and normalization to Unicode Form C. Owing to the mathematical nature of the punycode, the language information, as such is not supposed to be part of the punycode representation as such at all. It is the Unicode equivalent of the given punycode, that lies in specific Unicode range/block which gives the given character it's own script/language.
Hence, if one needs to have language/script detection capability of the IDN, then it needs to be converted to it's U-Label form first and then passed on to language/script detection routines.
To know about the various libraries that can be used in different programming languages for converting punycodes to their respective Unicode labels, please refer to the following two documents created by the "Universal Acceptance Steering Group"
UASG 018A UA Compliance of Some Programming Language Libraries and
Frameworks
(https://uasg.tech/download/uasg-018a-ua-compliance-of-some-programming-language-libraries-and-frameworks-en/ as well as
UASG 037 UA-Readiness of Some Programming Language Libraries and Frameworks EN"
(https://uasg.tech/download/uasg-037-ua-readiness-of-some-programming-language-libraries-and-frameworks-en/).
Is the encoding of risc-v instructions to opcode bits standardized? If so, where can I find the encoding table at least for the base 32I instructions?
I guess it is always a good idea to keep up to the specs on https://riscv.org/specifications/. There chapter 25 lists in details how to encode the instructions. I also liked http://riscvbook.com very much.
Regards Joachim
It looks like I found it in github.
https://github.com/riscv/riscv-opcodes/blob/master/opcodes
The tables in The RISC-V Reader book that Joachim mentioned are very good (https://riscvbook.com). Even if you don’t have the book, there’s a PDF version available for free in Spanish (and some other languages), which may be enough for your purposes.
Barring that, I find the PDFs from the rv8 project concise, and really useful: https://github.com/rv8-io/rv8/tree/master/doc/pdf. (It's information that of course is present in the specs, but I couldn't find a short, 10-page document there containing it all.) It’s generated from the riscv-meta project which has machine-parseable descriptions of the ISA, which may be useful as well depending what you’re trying to do.
I'm especially interested in implementation of RTP-MIDI protocol. The major difficulties could be faced in implementation of bit-fields and non-ordinary MIDI-like timestamps, as I can expect. And maybe if somebody knows already existed open source c++ implementations, please give me a reference to it.
I don't think so. As far as I can tell, RTP-MIDI is a very specific encoding. FlatBuffers is not able to emulate existing binary encoding/layout, it has its own encoding which typically does not match other binary encodings, even if the same information is stored.
FlatBuffers can generally be used with any protocol that can transport an opaque payload of bytes. RTP itself (not RTP-MIDI) could potentially be used with FlatBuffer data (after the RTP header).
In his excellent introduction to Rcpp, Eddelbuettel (2013), Dirk writes, on page 32:
But inline is very mature and tested, and the attributes functions
are at this point not of comparable maturity, the remainder of the
book will continue to use inline and its slightly more verbose
expression.
Now I must admit that I don't like using inline since having to include code as one string block is just too cumbersome, whatever the other advantages of inline might be. It is one of the few distracting factors in an otherwise excellent book (see the code in section 1.2.7 for an example).
And using attributes + sourceCpp has never lead to substantial problems for me. My questions are:
Given the 2 years that have elapsed since the publication of the book, have attributes caught up with inline?
Are there edge cases that inline can handle and attributes cannot?