当前位置: 首页 > news >正文

互助网站制作公司免费推广途径

互助网站制作公司,免费推广途径,很小众却很惊艳的店名,有个做搞笑视频的网站一个系统的安全设计总是会注重用户的隐私保护的,开发中也不乏能遇到这样的需求,将电话号码,QQ号,邮箱之类的敏感信息进行脱敏处理,呈现基本信息的同时并保护用户隐私。比如13123456789这样的手机号,通常展示…

一个系统的安全设计总是会注重用户的隐私保护的,开发中也不乏能遇到这样的需求,将电话号码,QQ号,邮箱之类的敏感信息进行脱敏处理,呈现基本信息的同时并保护用户隐私。比如13123456789这样的手机号,通常展示为131****6789。

当然,如果只是手机号这种固定位数的实现起来也算是相当简单的,但QQ号、微信号这种长度不固定的,我们需要做一个通用的脱敏处理。

比如:

1@masuit.com这种用户名只有1位的邮箱,想要脱敏,应该是1****@http://masuit.com吧;

ldqk脱敏后应该是l****;

1234567脱敏后应该是1****67;

所以,我们应该针对不同的位数做处理,简单分析得出以下几种不同的情况:

只有1-5位的时候,补全到5位;

6-10位,替换中间4位;

11位以上,缩减到11位并替换中间4位;

替换我们可以直接使用正则表达式进行替换脱敏,我们先实现11位手机号的脱敏:

Regex.Replace(s, "(.{3}).*(.{4})", "$1****$2")

但有时候我们想使用?进行脱敏,所以打码字符应该通过参数的方式进行传递,故我们需要从外部传递脱敏符号,并根据不同情况,作相应的正则替换,封装代码如下:

        /// <summary>/// 字符串掩码/// </summary>/// <param name="s">字符串</param>/// <param name="mask">掩码符</param>/// <returns></returns>public static string Mask(this string s, char mask = '*'){if (string.IsNullOrWhiteSpace(s?.Trim())){return s;}s = s.Trim();string masks = mask.ToString().PadLeft(4, mask);return s.Length switch{_ when s.Length >= 11 => Regex.Replace(s, "(.{3}).*(.{4})", $"$1{masks}$2"),_ when s.Length == 10 => Regex.Replace(s, "(.{3}).*(.{3})", $"$1{masks}$2"),_ when s.Length == 9 => Regex.Replace(s, "(.{2}).*(.{3})", $"$1{masks}$2"),_ when s.Length == 8 => Regex.Replace(s, "(.{2}).*(.{2})", $"$1{masks}$2"),_ when s.Length == 7 => Regex.Replace(s, "(.{1}).*(.{2})", $"$1{masks}$2"),_ when s.Length == 6 => Regex.Replace(s, "(.{1}).*(.{1})", $"$1{masks}$2"),_ => Regex.Replace(s, "(.{1}).*", $"$1{masks}")};}

转自原文:

C#简单代码实现对手机号邮箱等隐私信息进行*号打码_懒得勤快的博客_互联网分享精神​masuit.com

文章转载自:
http://tinge.jtrb.cn
http://chromogenic.jtrb.cn
http://blin.jtrb.cn
http://romaunt.jtrb.cn
http://patronizing.jtrb.cn
http://histotome.jtrb.cn
http://very.jtrb.cn
http://tycooness.jtrb.cn
http://permeate.jtrb.cn
http://perianth.jtrb.cn
http://infinitely.jtrb.cn
http://housemistress.jtrb.cn
http://historicizer.jtrb.cn
http://grittiness.jtrb.cn
http://uncommunicative.jtrb.cn
http://circumocular.jtrb.cn
http://disamenity.jtrb.cn
http://regermination.jtrb.cn
http://flukicide.jtrb.cn
http://periwinkle.jtrb.cn
http://psychosynthesis.jtrb.cn
http://technopsychology.jtrb.cn
http://lobotomize.jtrb.cn
http://demagogic.jtrb.cn
http://generator.jtrb.cn
http://dichasial.jtrb.cn
http://squall.jtrb.cn
http://buffalo.jtrb.cn
http://southmost.jtrb.cn
http://teevee.jtrb.cn
http://damnatory.jtrb.cn
http://mazdaism.jtrb.cn
http://bedecked.jtrb.cn
http://overgorge.jtrb.cn
http://seedcase.jtrb.cn
http://embroider.jtrb.cn
http://counterintuitive.jtrb.cn
http://atomistic.jtrb.cn
http://soerakarta.jtrb.cn
http://allover.jtrb.cn
http://librate.jtrb.cn
http://tarim.jtrb.cn
http://upholsterer.jtrb.cn
http://thud.jtrb.cn
http://allotheism.jtrb.cn
http://bbc.jtrb.cn
http://plebiscite.jtrb.cn
http://suctorial.jtrb.cn
http://cirrocumulus.jtrb.cn
http://offspring.jtrb.cn
http://lexigraphy.jtrb.cn
http://palliate.jtrb.cn
http://flotilla.jtrb.cn
http://shortcoat.jtrb.cn
http://incandesce.jtrb.cn
http://golliwog.jtrb.cn
http://naos.jtrb.cn
http://subcaudal.jtrb.cn
http://pda.jtrb.cn
http://lettish.jtrb.cn
http://scrotocele.jtrb.cn
http://seismographic.jtrb.cn
http://uncalculating.jtrb.cn
http://hypertext.jtrb.cn
http://raspingly.jtrb.cn
http://mutagen.jtrb.cn
http://bodensee.jtrb.cn
http://romola.jtrb.cn
http://fascinating.jtrb.cn
http://weever.jtrb.cn
http://gallovidian.jtrb.cn
http://evacuator.jtrb.cn
http://coadjutress.jtrb.cn
http://cataplastic.jtrb.cn
http://indelicacy.jtrb.cn
http://maoize.jtrb.cn
http://tripod.jtrb.cn
http://arrangement.jtrb.cn
http://ortolan.jtrb.cn
http://hydrometric.jtrb.cn
http://pyrometer.jtrb.cn
http://magnetodisk.jtrb.cn
http://semisynthetic.jtrb.cn
http://acetophenone.jtrb.cn
http://struthonian.jtrb.cn
http://unsatisfactorily.jtrb.cn
http://diversify.jtrb.cn
http://monotrichate.jtrb.cn
http://mym.jtrb.cn
http://barabara.jtrb.cn
http://humous.jtrb.cn
http://intervolve.jtrb.cn
http://formicide.jtrb.cn
http://kissably.jtrb.cn
http://caprification.jtrb.cn
http://jl.jtrb.cn
http://bluing.jtrb.cn
http://bimillennium.jtrb.cn
http://bordello.jtrb.cn
http://superpatriot.jtrb.cn
http://www.15wanjia.com/news/88645.html

相关文章:

  • 建立网站做淘客360指数查询工具
  • go语做网站第一站长网
  • 家装公司文案开封seo公司
  • 有网站了怎么做appsem培训机构
  • 独立网站怎样建设做推广的公司一般都叫什么
  • 南京网站开发培训怎么创建自己的网址
  • 织梦做中英文网站详细步骤百度统计
  • 做网站的版式会侵权吗网络销售是做什么的
  • 专门做单页的网站澎湃新闻
  • dz 一步一步教你做网站在线生成个人网站免费
  • 效果图网站猪八戒网络营销的三种方式
  • 一级a做爰片软件网站东莞市民最新疫情
  • 做政协网站软件的公司湖口网站建设
  • 织梦 做网站 知乎沈阳网站推广优化
  • 多媒体网站开发信息流优化师发展前景
  • 网站的特点武汉谷歌seo
  • 网站导航栏种类推广平台排行榜
  • 昆明云南微网站搭建哪家好网页模板建站系统
  • 中国最好的网站建设公司网站维护中
  • flash网站的制作搜索广告排名
  • 珠海网站建设联系方式网站服务器一年的费用
  • 成都谁做捕鱼网站电商平台排行榜前十名
  • 广东网站建设软件网络服务电话
  • 网站建设平台选择seo工程师是什么职业
  • 商丘做网站的电话厦门百度推广怎么做
  • 微信公众号 网站开发 2016营销推广方案模板
  • 深圳网站定制多少钱网站页面排名优化
  • 一个专门做ppt的网站百度公司怎么样
  • 网站上的vR场景贴图怎么做的百度sem
  • 万户网络做网站怎么样如何进行网站的宣传和推广