Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -module(m).
- -export([is_base64/1 ]).
- %%is_base64
- is_base64([])->false;
- is_base64(L) when is_list(L)->is_base64_ev(L);
- is_base64(L) when is_binary(L)->is_base64_ev(binary_to_list(L));
- is_base64(_)->false.
- is_base64_ev([])->true;
- is_base64_ev([C|_H]) when
- ((C <$0) orelse (C >$9)) andalso
- ((C < $a) orelse (C > $z))andalso
- ((C < $A) orelse (C > $Z))andalso
- (C /= $+)andalso
- (C /= $/)andalso
- (C /= $= )
- ->false;
- is_base64_ev([_C|H])->is_base64_ev(H).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement