what hashing function does solidity default compiler use in remix? - hash

As i'm new to solidity can someone guide me about the hashing function or encoding scheme which solidity default compiler use to encode or hash the input data of smart contracts in remix ide?

Related

Is there an option to enable overloading of user-defined symbols in cvc4 for SMT input?

In versions through 1.2 of the SMT-LIB language, overloading of user-defined symbols was allowed. Since version 2.0 of standard, overloading is restricted to theory symbol.
Nevertheless, some SMT-solvers still allow overloading of user-defined symbols and that happens to be handy for my use case: proof obligations are easily generated automatically with overloading, not so much without... I would like to add cvc4 to my portfolio of SMT solvers, but I found out that it produces a parsing error on overloaded user-symbols.
I am aware that this is the correct way to be compliant with the SMT-LIB standard, but I would like to know the following: Is there an option to CVC4 that disables such check and where the parser is able to disambiguate overloaded user symbols?
Unfortunately, CVC4 does not have an option to support overloaded user symbols. Each user symbol must be unique.

How do I calculate the md5 checksum of a string in starbasic macro (openoffice macro)?

I am trying to make an OpenOfficeWriter StarBasic-Macro Program, that turns wiki source code to Open office Writer. I need a starbasic macro, that generates the MD5 checksum. There is a MD5Thumbprint in the Documentation for OpenOffice, so I suppose you can compute the MD5 in a Open Office starbasic macro using some kind of macro code. This is what I'm looking for.
I suppose I have to use the XCertificate Interface in the security module, but I don't know how the macro code should be. So I need a Open Office starbasic macro command or code like: stringMD5=s.md5(), where will be a string (for example something like "Douglas C-47 Skytrain.jpg") and stringMD5 should be a string or something that I can make to a string (in this example the outcome in the end should be the string "40decfb5f1be8bca1e56c8a853027941", which is the MD5 for the String "Douglas C-47 Skytrain.jpg").
I would like to avoid using Python (see:How to get MD5 sum of a string?) and create a starbasic macro instead. If somebody has a tip, I will be of course very glad. George
The cryptographic extension seems to do what you want. However it may not work in recent versions of OpenOffice.
Otherwise, write the macro in a language such as Python or Java that can compute MD5 using a library.
Related: https://forum.openoffice.org/en/forum/viewtopic.php?f=5&p=391985

Can CoffeeScript be compiled to Haxe?

I'm learning Haxe now, and I'm wondering if it's possible for any programming language to be compiled to Haxe (instead of from Haxe.) If there isn't any programming language that can be compiled to Haxe in its entirety, then could at least a small subset of a programming language (such as Coffeescript) be compiled to Haxe?
At this time, there is no way to compile coffeescript or similar into Haxe.
CoffeeScript is a source-to-source compiler, so you would change need to change it from going CoffeeScript->JS to CoffeeScript->Haxe,
I'm not sure how difficult it would be, and you have to remember that Haxe has a bunch of features that Javascript doesn't, all of which would need to be represented in the "new" coffeescript. Things such as: type information, enums, typedefs, iterators, macros, conditional compilation, untyped blocks, metadata, property access etc. You would need to figure out how to represent each of these in coffeescript in a way which doesn't conflict with itself or with existing syntax.
I too have thought it might be nice, as CoffeeScript has such a clean syntax, but then looking at the complexity of getting it to work I decided that curly brackets and semi colons aren't so bad :)

Matlab code to .mex using code package

I would like to optimize a function written in Matlab by converting the code to C\C++. The result should be callable from within matlab, as it is a small part of a larger matlab code.
For example, converting my function to C code wrapped in a .mex file would work.
I heard matlab coder package can help with that.
As I am unfamiliar with this package, what is the quickest way to achieve this?
If you have a license for MATLAB Coder, then, yes, that is the correct package to use. The function you're looking for is codegen. There are restrictions on what can be used in code generation: to see if your function meets those restrictions, add the tag %#codegen to the beginning of your function as shown below
function foo(bar) %#codegen
<your code here>
and open the function file in the MATLAB editor. The tag tells the editor to check that the code complies with the rules for code generation. Once the editor shows that your code complies with those rules, generating the mex file may be as easy as
>> codegen foo
which would generate a mex-file, foo_mex in the current folder. For your particular function you may need to use some of the optional arguments for codegen to generate the mex-file properly.

Invalid character stream macros

The following preprocessor macro:
#define _VARIANT_BOOL /##/
is not actually valid C; roughly speaking, the reason is that the preprocessor is defined as working on a stream of tokens, whereas the above assumes that it works on a stream of characters.
On the other hand, unfortunately the above actually occurs in a Microsoft header file, so I have to handle it anyway. (I'm working on a preprocessor implementation.)
What other cases have people encountered in the wild, be it in legacy code however old as long as that code may be still in use, of preprocessor macros that are not actually valid, but work anyway because they were written under compilers that use a character oriented preprocessor implementation?
(Rationale: I'm trying to get some idea in advance how many special cases I'm going to have to hack, if I write a proper clean standard-conforming token oriented implementation.)
The relevant part of the standard (ยง6.10.3.3 The ## operator) says:
If the result is not a valid preprocessing token, the behavior is undefined.
This means that your preprocessor can do anything it likes and still be standard conforming, including emulating the common behaviour.
I think you can still have a "token-based" implementation and support this behaviour, by specifying that when the result of the ## operator is not a valid preprocessing token, the result is the two operand tokens unchanged. You may also want to have your preprocessor emit a warning about the invalid code.