Skip to content

Instantly share code, notes, and snippets.

Santiago Del Valle sdelvalle57

Block or report user

Report or block sdelvalle57

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@sdelvalle57
sdelvalle57 / bytesSort.sol
Created Jun 2, 2018
Sort array in solidity, could be easily used to sort any array of integers too
View bytesSort.sol
pragma solidity ^0.4.0;
contract ArraySort {
function sort_array(bytes memory arr) private pure returns (bytes) {
uint256 l = arr.length;
for(uint i = 0; i < l; i++) {
for(uint j = i+1; j < l ;j++) {
if(arr[i] > arr[j]) {
bytes1 temp = arr[i];
arr[i] = arr[j];
arr[j] = temp;
You can’t perform that action at this time.