import 'dart:convert';
import 'package:crypto/crypto.dart';

extension PhoneValidator on String {
  bool isPhoneValid() {
    return RegExp(r'^0\d{9}$').hasMatch(this);
  }
}

extension StringConvert on String {
  String toSha256() {
    var bytes1 = utf8.encode(this);         // data being hashed
    var digest1 = sha256.convert(bytes1);
    return digest1.toString();
  }
}