[{"data":1,"prerenderedAt":334},["ShallowReactive",2],{"content-en-getting-started":3},{"doc":4,"debug":331},{"id":5,"title":6,"body":7,"description":25,"extension":325,"meta":326,"navigation":90,"path":327,"seo":328,"stem":329,"__hash__":330},"content\u002Fen\u002Fgetting-started.md","Getting Started",{"type":8,"value":9,"toc":317},"minimark",[10,14,19,48,69,73,110,117,153,183,187,202,205,209,238,242,267,278,282,313],[11,12,6],"h1",{"id":13},"getting-started",[15,16,18],"h2",{"id":17},"install","Install",[20,21,26],"pre",{"className":22,"code":23,"language":24,"meta":25,"style":25},"language-bash shiki shiki-themes github-light","dotnet add package Ozakboy.TaiwanKit.TwIdValidator\n","bash","",[27,28,29],"code",{"__ignoreMap":25},[30,31,34,38,42,45],"span",{"class":32,"line":33},"line",1,[30,35,37],{"class":36},"s7eDp","dotnet",[30,39,41],{"class":40},"sYBdl"," add",[30,43,44],{"class":40}," package",[30,46,47],{"class":40}," Ozakboy.TaiwanKit.TwIdValidator\n",[49,50,51,52,55,56,55,59,55,62,55,65,68],"p",{},"Supported frameworks: ",[27,53,54],{},"netstandard2.0"," \u002F ",[27,57,58],{},"netstandard2.1",[27,60,61],{},"net8.0",[27,63,64],{},"net9.0",[27,66,67],{},"net10.0",", zero runtime dependencies.",[15,70,72],{"id":71},"national-id-validation-all-three-kinds-auto-detected","National ID validation (all three kinds auto-detected)",[20,74,78],{"className":75,"code":76,"language":77,"meta":25,"style":25},"language-csharp shiki shiki-themes github-light","using Ozakboy.TaiwanKit.TwIdValidator;\n\nTwId.IsValid(\"A123456789\");   \u002F\u002F true  national ID\nTwId.IsValid(\"A800000014\");   \u002F\u002F true  new-style UI number (2021+)\nTwId.IsValid(\"AB12345677\");   \u002F\u002F true  old-style ARC number (valid until 2031)\n","csharp",[27,79,80,85,92,98,104],{"__ignoreMap":25},[30,81,82],{"class":32,"line":33},[30,83,84],{},"using Ozakboy.TaiwanKit.TwIdValidator;\n",[30,86,88],{"class":32,"line":87},2,[30,89,91],{"emptyLinePlaceholder":90},true,"\n",[30,93,95],{"class":32,"line":94},3,[30,96,97],{},"TwId.IsValid(\"A123456789\");   \u002F\u002F true  national ID\n",[30,99,101],{"class":32,"line":100},4,[30,102,103],{},"TwId.IsValid(\"A800000014\");   \u002F\u002F true  new-style UI number (2021+)\n",[30,105,107],{"class":32,"line":106},5,[30,108,109],{},"TwId.IsValid(\"AB12345677\");   \u002F\u002F true  old-style ARC number (valid until 2031)\n",[49,111,112,113,116],{},"Use ",[27,114,115],{},"Validate"," when you need details:",[20,118,120],{"className":75,"code":119,"language":77,"meta":25,"style":25},"TwIdResult r = TwId.Validate(\"A123456789\");\n\u002F\u002F r.IsValid    → true\n\u002F\u002F r.Kind       → TwIdKind.NationalId\n\u002F\u002F r.Gender     → Gender.Male\n\u002F\u002F r.RegionName → \"臺北市\"\n\u002F\u002F r.Failure    → ValidationFailure.None\n",[27,121,122,127,132,137,142,147],{"__ignoreMap":25},[30,123,124],{"class":32,"line":33},[30,125,126],{},"TwIdResult r = TwId.Validate(\"A123456789\");\n",[30,128,129],{"class":32,"line":87},[30,130,131],{},"\u002F\u002F r.IsValid    → true\n",[30,133,134],{"class":32,"line":94},[30,135,136],{},"\u002F\u002F r.Kind       → TwIdKind.NationalId\n",[30,138,139],{"class":32,"line":100},[30,140,141],{},"\u002F\u002F r.Gender     → Gender.Male\n",[30,143,144],{"class":32,"line":106},[30,145,146],{},"\u002F\u002F r.RegionName → \"臺北市\"\n",[30,148,150],{"class":32,"line":149},6,[30,151,152],{},"\u002F\u002F r.Failure    → ValidationFailure.None\n",[49,154,155,156,159,160,55,163,55,166,55,169,172,173,55,176,55,179,182],{},"On failure, ",[27,157,158],{},"Failure"," tells you why (",[27,161,162],{},"NullOrEmpty",[27,164,165],{},"InvalidLength",[27,167,168],{},"InvalidFormat",[27,170,171],{},"InvalidChecksum","). When the format is recognizable but the checksum fails, ",[27,174,175],{},"Kind",[27,177,178],{},"Gender",[27,180,181],{},"RegionName"," are still populated — handy for \"right format, wrong number\" hints.",[15,184,186],{"id":185},"ban-validation","BAN validation",[20,188,190],{"className":75,"code":189,"language":77,"meta":25,"style":25},"TwBan.IsValid(\"04595257\");            \u002F\u002F true\nTwBan.Validate(\"04595258\").Failure;   \u002F\u002F ValidationFailure.InvalidChecksum\n",[27,191,192,197],{"__ignoreMap":25},[30,193,194],{"class":32,"line":33},[30,195,196],{},"TwBan.IsValid(\"04595257\");            \u002F\u002F true\n",[30,198,199],{"class":32,"line":87},[30,200,201],{},"TwBan.Validate(\"04595258\").Failure;   \u002F\u002F ValidationFailure.InvalidChecksum\n",[49,203,204],{},"The April 2021 rule (weighted sum divisible by 5) and the 7th-digit-7 special case are built in.",[15,206,208],{"id":207},"mobile-number-validation-normalization","Mobile number validation & normalization",[20,210,212],{"className":75,"code":211,"language":77,"meta":25,"style":25},"TwPhone.IsValid(\"0912345678\");   \u002F\u002F true (strict: 10 digits starting with 09)\n\n\u002F\u002F Real-world input often has country codes and separators — use TryNormalize\nTwPhone.TryNormalize(\"+886-912-345-678\", out string n);   \u002F\u002F true, n = \"0912345678\"\nTwPhone.TryNormalize(\"０９１２３４５６７８\", out n);        \u002F\u002F true (full-width digits too)\n",[27,213,214,219,223,228,233],{"__ignoreMap":25},[30,215,216],{"class":32,"line":33},[30,217,218],{},"TwPhone.IsValid(\"0912345678\");   \u002F\u002F true (strict: 10 digits starting with 09)\n",[30,220,221],{"class":32,"line":87},[30,222,91],{"emptyLinePlaceholder":90},[30,224,225],{"class":32,"line":94},[30,226,227],{},"\u002F\u002F Real-world input often has country codes and separators — use TryNormalize\n",[30,229,230],{"class":32,"line":100},[30,231,232],{},"TwPhone.TryNormalize(\"+886-912-345-678\", out string n);   \u002F\u002F true, n = \"0912345678\"\n",[30,234,235],{"class":32,"line":106},[30,236,237],{},"TwPhone.TryNormalize(\"０９１２３４５６７８\", out n);        \u002F\u002F true (full-width digits too)\n",[15,239,241],{"id":240},"test-data-generation","Test-data generation",[20,243,245],{"className":75,"code":244,"language":77,"meta":25,"style":25},"TwId.Generate(TwIdKind.NationalId, Gender.Female);   \u002F\u002F e.g. \"B234567891\"\nTwId.Generate(TwIdKind.OldResidentId, seed: 42);     \u002F\u002F reproducible with a seed\nTwBan.Generate();                                     \u002F\u002F e.g. \"51233458\"\nTwPhone.Generate();                                   \u002F\u002F e.g. \"0987654321\"\n",[27,246,247,252,257,262],{"__ignoreMap":25},[30,248,249],{"class":32,"line":33},[30,250,251],{},"TwId.Generate(TwIdKind.NationalId, Gender.Female);   \u002F\u002F e.g. \"B234567891\"\n",[30,253,254],{"class":32,"line":87},[30,255,256],{},"TwId.Generate(TwIdKind.OldResidentId, seed: 42);     \u002F\u002F reproducible with a seed\n",[30,258,259],{"class":32,"line":94},[30,260,261],{},"TwBan.Generate();                                     \u002F\u002F e.g. \"51233458\"\n",[30,263,264],{"class":32,"line":100},[30,265,266],{},"TwPhone.Generate();                                   \u002F\u002F e.g. \"0987654321\"\n",[268,269,270],"blockquote",{},[49,271,272,273,277],{},"⚠ Generated numbers are ",[274,275,276],"strong",{},"format-valid only"," — they never correspond to real persons or companies. Test data only.",[15,279,281],{"id":280},"behavioral-contract","Behavioral contract",[283,284,285,301,304,310],"ul",{},[286,287,288,289,292,293,296,297,300],"li",{},"Validation methods ",[274,290,291],{},"never throw"," — invalid input (incl. ",[27,294,295],{},"null",") returns ",[27,298,299],{},"false"," \u002F a failure result",[286,302,303],{},"Input is trimmed and upper-cased automatically",[286,305,306,307,309],{},"Obsolete region codes (L\u002FR\u002FS\u002FY) are still accepted (historical IDs remain valid), with ",[27,308,181],{}," marked \"（已停用）\"; the generator only uses active codes",[286,311,312],{},"Pure functions, thread-safe — use freely in any multi-threaded scenario",[314,315,316],"style",{},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .s7eDp, html code.shiki .s7eDp{--shiki-default:#6F42C1}html pre.shiki code .sYBdl, html code.shiki .sYBdl{--shiki-default:#032F62}",{"title":25,"searchDepth":87,"depth":94,"links":318},[319,320,321,322,323,324],{"id":17,"depth":87,"text":18},{"id":71,"depth":87,"text":72},{"id":185,"depth":87,"text":186},{"id":207,"depth":87,"text":208},{"id":240,"depth":87,"text":241},{"id":280,"depth":87,"text":281},"md",{},"\u002Fen\u002Fgetting-started",{"title":6,"description":25},"en\u002Fgetting-started","Ifg3UY4xaXbg986J7x8mbGhYE-nZ7PyCaARIPrctzy0",{"matched":332,"target":327,"all":333},"path()",null,1783231662482]