Skip to main content

Posts

Showing posts from November, 2015

Python: \n (New Line) from base64 Conversion

We can use different keywords to implement the string encoding from base64 module. Start by importing the module like so: import base64 # then, either: "the string to be converted".encode("base64") or add the "strict" option "the string to be converted".encode("base64", "strict") or base64.encode("the string to be converted") base64.encodestring("the string to be converted") base64.b64encode("the string to be converted") base64.standard_b64encode("the string to be converted") base64.urlsafe_b64encode("the url string to be converted") The first two methods will yield \n as the tail of the output. Those could be "dangerous" for authentication. Because if we forgot to include the front-end converter (such as in JavaScript , like adding replace or other), or other string filter(s) within the Python itself, the stuff would fail. And if the certain API ...

Fixing XHTML Parsing Error on Chrome: Specification mandate value for attribute async

This error message on Google Chrome console: Specification mandate value for attribute async That would happen if we generated XML page which acted as HTML , or XHTML . And we forgot to define the value for a particular HTML element attribute. In this case, the value for async attribute (in script element). The "async" Attribute Strictly Needs Value in XHTML Earlier, it was like this: <script type="application/javascript" src="URL_SOURCE" async></script> And the XHTML page wouldn't be rendered. It was just blank, but still with the XML attached (if we view the page source/inspect element). Solution To fix that, put the value for that attribute. We can put async , 1 , or true for that. Use async : <script type="application/javascript" src="URL_SOURCE" async="async"></script> Or use 1 : <script type="application/javascript...