This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Com máscara | |
/^\+?55 ?(\(\d{2}\)|\d{2}) ?(9 ?\d{4}|[2345]\d{3})(-?| ?)\d{4}$/ | |
// Sem máscara | |
/^55\d{2}(9\d{4}|[2345]\d{3})\d{4}$/ | |
Obrigatório uso de 55, se for opcional, adicionar ? após o 55 | |
9 é opcional, mas, se for não usado, apenas aceita 2 a 5 (números fixos) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;y = (ax + b) % mod | |
;In portuguese: https://youtu.be/S0-osj9rNoY | |
.define | |
x_n 00H | |
q_n 01H | |
a_n 02H | |
b_n 03H | |
m_n 04H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--Returns a table splitting some string with a delimiter | |
--Changes to enhance the code from https://gist.github.com/jaredallard/ddb152179831dd23b230 | |
function string:split(delimiter) | |
local result = {} | |
local from = 1 | |
local delim_from, delim_to = string.find(self, delimiter, from, true) | |
while delim_from do | |
if (delim_from ~= 1) then | |
table.insert(result, string.sub(self, from, delim_from-1)) | |
end |