解码excel日期掩码

如何解决解码excel日期掩码

我需要尝试找到一种算法来解码一组 Excel 日期。

一位前员工曾告诉我,他可以在 Excel 中对日期进行编码,但没有人会弄清楚,他说“就像大海捞针”。我的回答是“为什么有人要这样做?”在他因盗窃大量数据而离开后,我找到了一组标有“记录数字”的图表,从 T20000 到 T39999。这些图表应该有伴随的出生日期,但不要 - 缺少出生日期。这些图表隐藏在我们常用的 6 到 7 位数字和纯数字图表中,而不是以“T”开头。鉴于此背景(和其他数据),我怀疑这是出于无辜的原因并怀疑欺诈,例如医疗保险或保险欺诈。 “T”后面的 5 位数字可以对生日进行编码。这些数字类似于 Excel 用来存储日期的常用 5 位数字。通过寻找其他方法来查找生日,我能够找到一些生日。几个例子是:

Record #         Exel DOB   (real) DOB
T30007            27369     12/6/1974
T31414            16803     1/1/1946
T31738            22156     8/28/1960

其中有 2-3 K 没有出生日期。

简单的加法或减法是找不到答案的。我怀疑他添加(或减去)然后翻转单个数字,然后再次添加(或减去)或类似的算法。像扑克中的5张牌一样改变5位数字的顺序(前员工玩了很多扑克)。

我编写了一个 Excel VBA 程序来尝试使用以下试验来评估这一点:1) 将 1 添加到 9999,2) 然后切换最后 4 位数字的顺序,然后 3) 添加或减去 1 到 9999。但是,可能性数 (9999 * 2^4 * 9999 * 2 ) 远远超过 Excel 中的行限制(不包括非匹配项)并且将其分解成更小的部分在我的非游戏计算机上仍然运行速度太慢。我不精通 C、Java 或 Python,但怀疑这些可能是更好的选择。

我运行缓慢的 Excel VBA 代码:

Sub Decode_DOB()
'The accompanying table is Sheet1 which this runs off


Dim Org(111,5) As Long
Dim BD1(111,5) As Long
Dim Var_1(111,5) As Long
Dim VarTT(111) As Long
Dim VarTT1(111) As Long
Dim VarTT2(111) As Long
Dim Save_Counter As Long
Dim icounter As Long
Dim int_Digit_Count As Integer


Save_Counter = 1 'Counter to save the spreadsheet at intervals
 

icounter = 2  'Counter to keep track of current row number


'Org(x,y) array to store the original chart record starting with "T"
'Org(n2,0) for the total 5 digit number,then Org(n2,1 to 5) to break out each digit

For n2 = 2 To 25
Org(n2,0) = Sheet1.Cells(n2,2).Value
Org(n2,1) = Mid(Org(n2,0),1,1)
Org(n2,2) = Mid(Org(n2,2,3) = Mid(Org(n2,3,4) = Mid(Org(n2,4,5) = Mid(Org(n2,5,1)
Next n2

'BD1(x,y) array to store the original chart record starting with "T"
'BD1(n1,then BD1(n1,1 to 5) to break out each digit

For n1 = 2 To 25
BD1(n1,0) = Sheet1.Cells(n1,28).Value
BD1(n1,1) = Mid(BD1(n1,1)
BD1(n1,2) = Mid(BD1(n1,3) = Mid(BD1(n1,4) = Mid(BD1(n1,5) = Mid(BD1(n1,1)
Next n1


'Sequentially try adding 1 to 9999

For n = 1 To 9999
For i = 2 To 25
Var_1(i,0) = Org(i,0) - n
Var_1(i,1) = Mid(Var_1(i,1)
Var_1(i,2) = Mid(Var_1(i,3) = Mid(Var_1(i,4) = Mid(Var_1(i,5) = Mid(Var_1(i,1)

'Sequentially "Flip the digits" or "Cards" only using the last 4
For k = 2 To 5
For l = 2 To 5
For m = 2 To 5
For p = 2 To 5
'Combine digits to get the total 5 digit number
VarTT(i) = Var_1(i,1) * 10000 + Var_1(i,k) * 1000 + Var_1(i,l) * 100 + Var_1(i,m) * 10 + Var_1(i,p)

'Sequentially  and and subtract from the result
For ii = 1 To 9999
VarTT1(i) = VarTT(i) + ii
VarTT2(i) = VarTT(i) - ii

    'Test valid "Flips" - only one of each digit allowed
    'and the total 1+2+3+4+5 should = 15
    
    int_Digit_Count = 1 + k + l + m + p
    If (k = l Or k = m) Or k = p Then
    int_Digit_Count = 0
    End If
    
    If l = m Or l = p Then
    int_Digit_Count = 0
    End If
    
    If m = p Then
    int_Digit_Count = 0
    End If
    
    
    'test to see if the result matches the birthdate
    If VarTT1(i) = BD1(i,0) Or VarTT2(i) = BD1(i,0) Then
    'and test for valid "Flip"
    If int_Digit_Count = 15 Then
    
    'If the sequence and valid flip creates a match,write to Sheet2
           
        Sheet2.Cells(icounter,1).Value = i
        Sheet2.Cells(icounter,2).Value = Org(i,0)
        Sheet2.Cells(icounter,3).Value = Org(i,0) - n
        Sheet2.Cells(icounter,4).Value = VarTT(i)
        Sheet2.Cells(icounter,5).Value = BD1(i,6).Value = n
        Sheet2.Cells(icounter,7).Value = Var_1(i,1)
        Sheet2.Cells(icounter,8).Value = Var_1(i,2)
        Sheet2.Cells(icounter,9).Value = Var_1(i,3)
        Sheet2.Cells(icounter,10).Value = Var_1(i,4)
        Sheet2.Cells(icounter,11).Value = Var_1(i,5)
        
        Sheet2.Cells(icounter,13).Value = 1
        Sheet2.Cells(icounter,14).Value = k
        Sheet2.Cells(icounter,15).Value = l
        Sheet2.Cells(icounter,16).Value = m
        Sheet2.Cells(icounter,17).Value = p
        
        Sheet2.Cells(icounter,19).Value = VarTT1(i)
        Sheet2.Cells(icounter,20).Value = VarTT2(i)
        Sheet2.Cells(icounter,21).Value = ii
        
        FlipPattern = 1 * 10000 + k * 1000 + l * 100 + m * 10 + p
        
        Sheet2.Cells(icounter,22).Value = FlipPattern
              
                      
        
        icounter = icounter + 1
        
        'Save the spreadsheet every 5000 rows in case the program "blows up"
        Save_Counter = Save_Counter + 1
        
            If Save_Counter > 5000 Then
                ActiveWorkbook.Save
                Save_Counter = 1
                Sheet2.Cells(1,12).Value = icounter
                Sheet2.Cells(icounter,24).Value = Time()
                Application.Wait (Now + TimeValue("00:00:01"))
            End If
    
            
    End If
    End If
    
'ii for last number added or subtracted
    Next ii

'p,m,l,k for flip sequences
Next p
Next m
Next l
Next k

'For each "T" number on Sheet 1
Next i

Next n
'Matches can then be sorted on n,"Flip" and ii and look for a "common denominator"
End Sub



Sub Sort_Matches()
'Run this after sorting to mark multiple matches and filter
last_row = Sheet5.Cells(Rows.count,1).End(xlUp).Row

For ijj = 2 To last_row

If Sheet5.Cells(ijj,6).Value = Sheet5.Cells(ijj - 1,6).Value Then
If Sheet5.Cells(ijj,21).Value = Sheet5.Cells(ijj - 1,21).Value Then
If Sheet5.Cells(ijj,22).Value = Sheet5.Cells(ijj - 1,22).Value Then

Sheet5.Cells(ijj - 1,23).Value = "XX"
Sheet5.Cells(ijj,23).Value = "XX"

End If
End If
End If

Next ijj


End Sub

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


依赖报错 idea导入项目后依赖报错,解决方案:https://blog.csdn.net/weixin_42420249/article/details/81191861 依赖版本报错:更换其他版本 无法下载依赖可参考:https://blog.csdn.net/weixin_42628809/a
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下 2021-12-03 13:33:33.927 ERROR 7228 [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPL
错误1:gradle项目控制台输出为乱码 # 解决方案:https://blog.csdn.net/weixin_43501566/article/details/112482302 # 在gradle-wrapper.properties 添加以下内容 org.gradle.jvmargs=-Df
错误还原:在查询的过程中,传入的workType为0时,该条件不起作用 <select id="xxx"> SELECT di.id, di.name, di.work_type, di.updated... <where> <if test=&qu
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct redisServer’没有名为‘server_cpulist’的成员 redisSetCpuAffinity(server.server_cpulist); ^ server.c: 在函数‘hasActiveC
解决方案1 1、改项目中.idea/workspace.xml配置文件,增加dynamic.classpath参数 2、搜索PropertiesComponent,添加如下 <property name="dynamic.classpath" value="tru
删除根组件app.vue中的默认代码后报错:Module Error (from ./node_modules/eslint-loader/index.js): 解决方案:关闭ESlint代码检测,在项目根目录创建vue.config.js,在文件中添加 module.exports = { lin
查看spark默认的python版本 [root@master day27]# pyspark /home/software/spark-2.3.4-bin-hadoop2.7/conf/spark-env.sh: line 2: /usr/local/hadoop/bin/hadoop: No s
使用本地python环境可以成功执行 import pandas as pd import matplotlib.pyplot as plt # 设置字体 plt.rcParams['font.sans-serif'] = ['SimHei'] # 能正确显示负号 p
错误1:Request method ‘DELETE‘ not supported 错误还原:controller层有一个接口,访问该接口时报错:Request method ‘DELETE‘ not supported 错误原因:没有接收到前端传入的参数,修改为如下 参考 错误2:cannot r
错误1:启动docker镜像时报错:Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen 解决方法:重启docker -> systemctl r
错误1:private field ‘xxx‘ is never assigned 按Altʾnter快捷键,选择第2项 参考:https://blog.csdn.net/shi_hong_fei_hei/article/details/88814070 错误2:启动时报错,不能找到主启动类 #
报错如下,通过源不能下载,最后警告pip需升级版本 Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4) Coll
错误1:maven打包报错 错误还原:使用maven打包项目时报错如下 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
错误1:服务调用时报错 服务消费者模块assess通过openFeign调用服务提供者模块hires 如下为服务提供者模块hires的控制层接口 @RestController @RequestMapping("/hires") public class FeignControl
错误1:运行项目后报如下错误 解决方案 报错2:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sb 解决方案:在pom.
参考 错误原因 过滤器或拦截器在生效时,redisTemplate还没有注入 解决方案:在注入容器时就生效 @Component //项目运行时就注入Spring容器 public class RedisBean { @Resource private RedisTemplate<String
使用vite构建项目报错 C:\Users\ychen\work>npm init @vitejs/app @vitejs/create-app is deprecated, use npm init vite instead C:\Users\ychen\AppData\Local\npm-